<template>
    <el-form ref="form" :model="userForm" >
        <el-form-item>
            <el-input v-model="userForm.username" placeholder="用户名"></el-input>
        </el-form-item>
        <el-form-item>
            <el-input v-model="userForm.phone" placeholder="手机号"></el-input>
        </el-form-item>
        <el-form-item>
            <el-input v-model="userForm.role" placeholder="角色"></el-input>
        </el-form-item>
        <el-form-item>
            <el-date-picker type="date" placeholder="出生日期" v-model="userForm.birthday" style="width: 100%;"></el-date-picker>
        </el-form-item>
        <el-form-item>
            <el-input v-model="userForm.password" placeholder="密码"></el-input>
        </el-form-item>
        <el-form-item>
            <el-input v-model="userForm.check" placeholder="请重现输入密码"></el-input>
        </el-form-item>
        <el-form-item>
            <el-button type="primary" id="register-btn" :loading="registerBtnTag" @click="onSubmit">{{registerBtnMsg}}</el-button>
        </el-form-item>
    </el-form>
</template>

<script>
    export default {
        name: "Register",
        data() {
            return {
                registerBtnMsg:"立即创建",
                registerBtnTag:false,
                userForm: {
                    username: '',
                    phone: '',
                    role: '',
                    birthday:'',
                    password: '',
                    check:''
                }
            }
        },

        methods: {
            onSubmit() {
                this.registerBtnTag = true;
                this.registerBtnMsg = "正在注册请稍等..."
            }
        }
    }
</script>

<style scoped>
    #register-btn{
        width: 100%;
    }
</style>